<template>
	<div class="people">
		<v-Header :item="headerMess"></v-Header>
		
		<div class="title">
			<span>用户</span>
			<span>点买金额</span>
			<span>注册时间</span>
		</div>
		<v-Content>
			<mt-loadmore :top-method="loadTop" :bottom-method="loadBottom" :bottom-all-loaded="allLoaded" ref="loadmore" :autoFill="false" >

				<div v-for="app in getScoreLog ">
					<p>
						<span style="width:2.5rem;">{{app.userName}}</span>
						<span> <!--style="color: #FF335B;"--> {{app.tenderCount}}万元</span>
						<span>{{app.registerTime | toDot}}</span>
					</p>
					
				</div>
			</mt-loadmore>
			<div class="img" v-show="getScoreLog.length==0">
				<img src="../../assets/default_record.png"/>
				<p   style="background: #0c101c; border: none;">暂无记录</p>
			</div>
		</v-Content>
	</div>
</template>

<script>
import Header from '@/components/Header'
import Content from '@/components/ContentBottom2'
import find from '@/api/find/index'
import { toast} from '@/util/index'
import {Loadmore} from 'mint-ui'
export default{
  	data(){
  		return{
  			headerMess:{
		        src:require("../../assets/nav_back.png"),
		        headerText: '我的用户',
		        right: ''
		   },
		    getScoreLog: [],     //总数
	        pageNo: 2,           //页数
	        allLoaded: false,    //
	        bottomText: '上拉加载更多...',
	        totalPage: '',       //总共
	        scrollMode:"touch",// iphone或安卓机存在问题
  		}
  	},
  	methods:{
  		loadTop() {
		  	this.$refs.loadmore.onTopLoaded();
		},
  		loadBottom() {
	        this.pageNo += 1;
	        if (this.pageNo == this.totalPage) {
	          this.allLoaded = true;
	        }                                            
	        setTimeout(() => {
		        let senddata = {
					userId:window.localStorage.getItem("token"),
					page:this.pageNo,
					plat:"mlj"
				}
				find.myUser(senddata).then((res) => {
					if (res.data.code == 200) {
						this.getScoreLog = this.getScoreLog.concat(res.data.data.list);
						this.$refs.loadmore.onBottomLoaded();
					} else if(res.data.code == 103){
						this.$router.push({path:'/realnameInfo'})
					} else {
						toast(res.data.message)
					}
				})
	        }, 1500);
	    },
	    
  	},
  	filters:{
  		toDot(val){
  			return val.substr(0, 10);
  		}
  	},
  	components:{
  		"v-Header":Header,
  		'v-Content':Content,
  		'mt-loadmore':Loadmore
  	},
  	 mounted(){
		let senddata = {
			userId:window.localStorage.getItem("token"),
			page:1,
			plat:"mlj"
		}
		
		find.myUser(senddata).then((res) => {
			if (res.data.code == 200) {
				this.getScoreLog=res.data.data.list;
				this.totalPage=res.data.data.totalPage;
				//this.two();
			} else if(res.data.code == 103){
				this.$router.push({path:'/realnameInfo'})
			}else if(res.data.code==222){
	            this.$router.push({path:'/login'})
	        } else {
				toast(res.data.message)
			}
		})
	},
	  beforeRouteEnter(to,from,next){
	    document.querySelector('title').innerText='谋略家'
	      next()
	  }
}
</script>

<style lang="less" scoped>
@import '../../less/config.less';
.people{
	position:relative;
	height:100%;
	
	.title{
		display: flex;
		justify-content:space-between;
		align-items: center;
		padding: 0 @p30;
		height:1.1rem;
		line-height:1.0933rem;
		color:#999;
		background:#141723;
		font-size:@p30;
	}
	p{
		padding: 0 @p30;
		color: white;
		display: flex;
		justify-content: space-between;
		align-items: center;
		height:1.1733rem;
		background: @liBg;
		border-top: 1px solid #262934;
		span{
			font-size: @f28;
		}
	}
	.img{
		margin-top: 2.5rem;
		display: flex;
		color: #0296af;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		p{
			color: #0296af;
		}
		img{
			 width: 2.66666rem; 
			 height: 2.66666rem;
			
		}
	}
}
	

</style>